package com.mycompany.dewcineplanet.repository;

import java.util.ArrayList;
import java.util.List;

import com.mycompany.dewcineplanet.model.Sala;

public class SalaRepository {

	List<Sala> list = null;

	public SalaRepository(){
		list = new ArrayList<Sala>();
		list.add(new Sala(new Long(1), new Long(6)));
		list.add(new Sala(new Long(2), new Long(20)));
		list.add(new Sala(new Long(3), new Long(20)));
		list.add(new Sala(new Long(4), new Long(20)));
		list.add(new Sala(new Long(5), new Long(20)));
	}

	public List<Sala> obtenerTodaSala(){
		return list;
	}

	public Sala obtenerSala(Long codigo){
		if(codigo != null){
			for(int i = 0; i < list.size(); i++){
				Sala _sala = list.get(i);
				if(_sala.getCodigo().equals(codigo)){
					return _sala;
				}
			}
		}
		return null;
	}
}